Skip to content

feat(ops-port): add desk, ruling lapse and the nightly memory settle - #46

Merged
Exploitacious merged 8 commits into
mainfrom
chore/ops-port-2026-12-04
Dec 4, 2026
Merged

Exploitacious merged 8 commits into
mainfrom
chore/ops-port-2026-12-04

Conversation

@Exploitacious

Copy link
Copy Markdown
Owner

What this brings to a box

  • The desk check. bin/desk reports only what it can prove is wrong with the instructions a session loads: a core file that equals an older template version, a dead reference in an always-loaded file, a ruling row with no valid kind or a setup row past its review date. What it could not read is listed as unread, never as clean. The daily sync runs it once a day; the session briefing shows its one cached line and never scans.
  • Ruling kinds and lapse. CONTEXT/standing-orders.md and BOOTSTRAP.md describe a Kind column (setup, preference, guardrail). The daily sync runs desk lapse, which moves a setup ruling past its review date to CONTEXT/standing-orders-archive.md in one commit and leaves a one-time briefing notice; desk keep restores it. A table with no Kind column is left alone, and the template sync never rewrites an existing table.
  • The owner review. desk review, desk commit-review and desk undo: the owner answers keep, narrow or retire for at most ten of their own rulings, desk commits exactly those answers, and undo puts the bytes back. Every desk write is a plumbing commit of the planned bytes, refuses a checkout with an executable commit hook instead of bypassing it, swaps files in with renameat2, and recovers or holds after an interruption.
  • The nightly memory settle, opt-in per box. memory-index --settle archives, byte for byte into <pool>/_archive/, the entries a pool's digest cannot describe, and commits the moves in the box's own checkout. The template runs it in local mode only; it never fetches, adds a remote or pushes. It stays off until a box's named rollout installs its units and env file; deploy only keeps installed copies current and never installs, creates the env file or enables the timer. --find and the prompt hint also search the archives, and --restore brings an entry back. The 60-entry pool warning is gone; gate check 6b reads the settle's status and SKIPs where it is not installed.
  • Smaller ports. The secrets scanner and the thread card refuse age post-quantum identities. The armed compactor's dispatch-time recheck gains its unit and client tests, and the context-watch self-test gains two card-route cases.

Gates (local, before this pull request)

  • Template gate as CI runs it (syntax, every suite and self-test under sandbox-run, the secrets scanner): every suite passes except one timing case in memory-hint-test.sh, which measured over its 300 ms limit on a heavily loaded machine. main fails the same case on that machine at the same time, so this pull request's CI run is the check that counts for it.
  • gitleaks git --redact over the branch and its full reachable history: no leaks.
  • Stage-1 contract (test_stage1.py with OPS_DIR set to this branch): test_ops_model_rules_match_the_real_verify_ops passes. One unrelated pyenv migration case fails on the local host with and without this branch.
  • Fresh-install smoke in sandbox-run: deploy twice, then verify-ops.sh: 0 fail; deploy installs no settle unit or env file.
  • Private-term scan of the tree, the history, this title and this body: clean.
  • One second-vendor review of the deploy, gate, settle and briefing code. Its fixes are in the last commit: a paused settle is honored on manual runs, and deploy defers the systemd reload when T3's reload state is unknown. Two findings stay open as follow-ups: deploy replaces a hand-edited installed unit file, and the briefing's desk line is unverified on native Windows.

Rollout notes

  • Nothing turns on by itself: the desk line appears after the first daily sync; lapse acts only on a table that has the Kind column; the settle needs its per-box rollout (.claude-config/bin/README.md, "The nightly memory settle").
  • To turn the desk off, remove run_lapse and run_desk from daily-sync.sh and delete desk-last.json. To turn the settle off, disable its timer or set MEMORY_SETTLE=0 in ~/.config/ops/memory-settle.env.

Models: Mythos 5.2, Opus 5.5 (build), Sol GPT-6.2 one round, Claude Code in T3 Code

standing-orders.md gains a fourth column, Kind: setup (with a review date 14 days out), preference or guardrail, and its header explains them. BOOTSTRAP.md writes a non-default Round C posture as setup, Rounds D to F as preference, and box ground rules as guardrail. desk lapse moves a setup ruling past its review date to standing-orders-archive.md unless the Operator says keep; the tool arrives with the clean desk port.
The harness skill gains a short section on the clean desk review: what cleaning the desk means, the three ruling kinds (setup lapses 14 days after its date unless kept; preference; guardrail, answered alone), that a lapsed or retired ruling is kept in standing-orders-archive.md and nothing is deleted, and the desk commands (desk, review, commit-review, keep, undo). The commands arrive with the template update that carries them.
age 1.4's age-keygen makes AGE-SECRET-KEY-PQ-1 identities by default; the classical shape alone missed them. secrets-scan.sh and card's hard list both take the optional PQ- infix. Cases in card-test.py and secrets-guard-test.sh, built from parts so the files hold no matchable key; both fail on the parent tree.
…te key

OPS #44 carried the arm recheck (compact-arm-check, compact --arm-record) without its unit and t3-api cases; this adds them as the source repo landed them. context-watch-selftest gains the CARD_THREAD-alone key case and the dispatch marker for another baton, and its helpers unset the host's CARD_THREAD so a test run inside a T3 thread cannot change the route.
memory-index --settle archives, byte for byte into <pool>/_archive/, the lowest-ranked entries a pool's own digest cannot describe; --restore brings one back and --health records a row per run. The template runs it in local mode only (MEMORY_SETTLE_MODE=local and MEMORY_SETTLE_ROOT in ~/.config/ops/memory-settle.env): it commits in the owner's checkout through a checked write path (settle lock, checkout flock, journal recovery, captured paths, a temporary-index plumbing commit moved by compare-and-swap, executable commit hooks refused) and never fetches, adds a remote or pushes. Any other or missing mode is refused, never guessed. The index writer waits briefly on the settle lock, and the env reader fails closed on any form systemd could read differently.

--find and --hint also read each pool's _archive/, and --find the CONTEXT/projects lessons paragraphs. The 60-entry pool cap warning is gone; verify-ops check 6b now reads the settle's status file and SKIPs on a box without it. memory-backfill-modified stamps missing metadata.modified once before a first settle.

Opt-in by presence: deploy step 11 keeps installed units and the local-mode drop-in current and never installs, creates the env file, enables or starts anything; the named rollout does that per box (bin/README.md, Team box install). memory_settle.py and memory-backfill-modified join OPS_DESTRUCTIVE_TOOLS, their two suites OPS_SANDBOX_SUITES. README also documents t3-api.sh compact --arm-record.
…review

bin/desk, one self-contained file shared with the tree the template comes from, checks the AI context a session loads (stale core, dead references, ruling rows, duplicate pools) and caches one line in OPS_STATE_DIR; desk lapse, keep, review, commit-review and undo rewrite and commit the owner's rulings through a checked write path (plumbing commit, commit hooks refused, renameat2 swap, journal recovery).

daily-sync.sh runs run_lapse then run_desk, both non-fatal with one sync.log line each. session-briefing.sh shows the cached Desk line and the one-time lapse notice from OPS_STATE_DIR, reading only. desk joins OPS_DESTRUCTIVE_TOOLS and its three suites OPS_SANDBOX_SUITES. desk-test.py sets OPS_DIR beside COWORK_DIR in its daily-sync harness; session-briefing-desk-test.sh pins this hook's full briefing on resume (it has no resume short form). README desk section and CHANGELOG for the whole pass.
deploy-trust-test.sh evaluates deploy.sh from the trust assignment to the next section; step 11 now follows the trust step, so the cut ends at either section header.
… unknown T3 state

Review fixes. A manual settle now reads MEMORY_SETTLE through the shared
env-file reader, so the file's pause wins over a stale shell value. Deploy
defers daemon-reload when the T3 status query fails or answers an unknown
value. Tests cover both.
@Exploitacious
Exploitacious merged commit fb48594 into main Dec 4, 2026
8 checks passed
@Exploitacious
Exploitacious deleted the chore/ops-port-2026-12-04 branch December 4, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant